package com.yun.newBlog.blog.dao.blog;

import com.github.pagehelper.Page;
import com.yun.newBlog.blog.domain.entity.Blog;
import com.yun.newBlog.blog.vo.BlogPageQueryOutVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface BlogMapper extends Mapper<Blog> {

    @Select("select id,title,sort,summary,cover,tag,cover,crt_tim,eye,likes,comment from blog where 1=1 and sort = #{sort} and tag = #{tag} order by crt_tim desc")
    Page<BlogPageQueryOutVO> queryPageBySortAndTag(@Param("sort") String sort, @Param("tag") String tag);

    @Select("select id,title,sort,summary,cover,tag,cover,crt_tim,eye,likes,comment from blog where 1=1 and sort = #{sort} order by crt_tim desc")
    Page<BlogPageQueryOutVO> queryPageBySort(@Param("sort") String sort);
}